﻿using System.Collections.Generic;
using System.Collections.Specialized;
using System.Web.Mvc;

namespace Fuse8.ContentManagementFramework.Administration.Models.MetaFields
{
    /// <summary>
    /// Provides contract for using any data source as values that can be selected for meta
    /// </summary>
    public interface IMetaFieldValuesProvider
    {
        /// <summary>
        /// Unique provider name
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Additional view on add/edt meta form
        /// </summary>
        string AdministrationViewName { get; }

        bool CanAddItem { get; }

        /// <summary>
        /// Gets ource for list control
        /// </summary>
        /// <returns></returns>
        IEnumerable<CmsKeyValueItem> GetDataSource(string settings);

        /// <summary>
        /// Adds new item in source
        /// </summary>
        /// <param name="text"></param>
        /// <param name="settings"></param>
        /// <returns></returns>
        SelectListItem AddNewItem(string text, string settings);

        string GetSettings(ControllerContext modelState);
        void SetSettings(ViewDataDictionary viewData, string settings);
    }
}